home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-19 / jan93cad.zip / PROGRAM.LSP < prev    next >
Lisp/Scheme  |  1993-02-12  |  2KB  |  73 lines

  1. ;; Program For AutoLISP Dialog Box Menu
  2. (defun C:PROGRAM (/ ai_defaults dcl_id old_cmd
  3.                    old_error PRG TILE what_next)
  4.   (defun PROGRAM_MAIN ()
  5.     (if (not (new_dialog "PROGRAM" dcl_id)) (exit))
  6.       (action_tile "accept"" (done_dialog)")
  7.       (action_tile "cancel"" (done_dialog)")
  8.       (action_tile "PLN1" "(setq PRG $key)")
  9.       (action_tile "PLN2" "(setq PRG $key)")
  10.       (action_tile "PLN3" "(setq PRG $key)")
  11.       (action_tile "PLN4" "(setq PRG $key)")
  12.       (action_tile "PLN5" "(setq PRG $key)")
  13.       (action_tile "PLN6" "(setq PRG $key)")
  14.       (action_tile "PLN7" "(setq PRG $key)")
  15.       (action_tile "PLN8" "(setq PRG $key)")
  16.       (action_tile "PLN9" "(setq PRG $key)")
  17.       (action_tile "PLN10" "(setq PRG $key)")
  18.  
  19.   (setq what_next (start_dialog))
  20.    (if (= 1 what_next)
  21.     (progn
  22.       (if (assoc "PROGRAM" ai_defults)
  23.        (setq ai_defults (subst (list "PROGRAM" on_screen)
  24.        (assoc "PROGRAM" ai_defaults)
  25.                ai_defaults
  26.   )))))
  27.   (do_action PRG)
  28.   );end defun main
  29.  
  30. ;; Setup Error Function
  31. (setq old_cmd (getvar "cmdecho")
  32.      old_error  *error*
  33.       *error* ai_error
  34. )
  35. (setvar "cmdecho" 0)
  36. (cond
  37.    ((not (ai_notrans)))
  38.    ((not (ai_acadapp)))
  39.    ((not (setq dcl_id (ai_dcl "PROGRAM"))))
  40.    (t (PROGRAM_MAIN))
  41. )
  42. (setq *error* old_error)
  43. (setvar "cmdecho" old_cmd)
  44. (done_dialog dcl_id)
  45. (princ)
  46. )
  47.  
  48. (defun DO_ACTION (PRG)
  49.   (cond
  50.     ((= PRG "PLN1") (load "PLN1") (c:PLN1))
  51.     ((= PRG "PLN2") (load "PLN2") (c:PLN2))
  52.     ((= PRG "PLN3") (load "PLN3") (c:PLN3))
  53.     ((= PRG "PLN4") (load "PLN4") (c:PLN4))
  54. .   ((= PRG "PLN5") (load "PLN5") (c:PLN5))
  55.     ((= PRG "PLN6") (load "PLN6") (c:PLN6))
  56.     ((= PRG "PLN7") (load "PLN7") (c:PLN7))
  57.     ((= PRG "PLN8") (load "PLN8") (c:PLN8))
  58.     ((= PRG "PLN9") (load "PLN9") (c:PLN9))
  59.     ((= PRG "PLN10") (load "PLN10") (c:PLN10))
  60. ))
  61. ;****************************
  62. (defun C:PLN1 ()
  63.   (repeat 3
  64.     (prompt "\nYou selected Program Option 1!")
  65.   )
  66. )
  67. ;****************************
  68. (defun C:PLN2 ()
  69.   (repeat 3
  70.     (prompt "\nYou selected Program Option 2!")
  71.   )
  72. )
  73.